package com.lcz.authority.common.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lcz.authority.common.annotation.Excel;
import com.lcz.authority.common.domain.BaseEntity;
import com.zhou.starter.jpacomment.annotation.ColumnComment;
import com.zhou.starter.jpacomment.annotation.TableComment;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * @author lcz
 * @desc 配置实体类
 * @mail lcz_0130@163.com
 * @date 2024/05/07
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_config")
@Table(name = "sys_config")
@Entity
@TableComment("参数配置表")
public class SysConfigEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @Id
    @TableId(type = IdType.ASSIGN_ID)
    @ColumnComment("主键id")
    private String configId;

    /**
     * 参数名称
     */
    @NotBlank(message = "参数名称不能为空")
    @Size(max = 100, message = "参数名称不能超过100个字符")
    @Excel(name = "参数名称")
    @ColumnComment("参数名称")
    private String configName;

    /**
     * 参数键名
     */
    @NotBlank(message = "参数键名不能为空")
    @Size(max = 100, message = "参数键名长度不能超过100个字符")
    @Excel(name = "参数键名")
    @ColumnComment("参数键名")
    private String configKey;

    /**
     * 参数键值
     */
    @NotBlank(message = "参数键值不能为空")
    @Size(max = 500, message = "参数键值长度不能超过500个字符")
    @Excel(name = "参数键值")
    @ColumnComment("参数键值")
    private String configValue;

    /**
     * 系统内置（Y是 N否）
     */
    @NotBlank(message = "系统内置不能为空")
    @Excel(name = "系统内置", readConverterExp = "Y=是,N=否")
    @ColumnComment("系统内置")
    private String configType;

    /**
     * 所属分类的编码
     */
    @NotBlank(message = "所属分类的编码不能为空")
    @ColumnComment("所属分类的编码")
    private String groupCode;

    /**
     * 备注
     */
    @ColumnComment("备注")
    private String remark;
}
